package com.jianxiu.bean;

public class Result {
    private String code;
    private String message;
    private Object data;
    private boolean success;

    public final static boolean SUCCESS = true;

    public Result(boolean b, String msg, Object object) {
        this.success = b;
        this.message = msg;
        this.data = object;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public static Result success(Object object) {
        return new Result(true, "", object);
    }

    public static Result success() {
        return new Result(SUCCESS, "", null);
    }

    public static Result byMsg(String msg) {
        return new Result(false, msg, null);
    }
}
